function add(a,b){
    return a+b;
}
var result = add(1,2);
console.log(result);

//阶乘函数 6 8 9
function mul(num){
    var total = 1;
    for(var i=num;i>1;i--){
        total = total*i;
    }
    return total;
}
mul(6);
console.log(mul(6));

//递归阶乘  出口 递归条件
function mul2(num){
    if(num>1){
        return num*mul2(num-1);
    }
    else{
        return 1;
    }
}
console.log(mul2(4));
